package com.damuzee.lvyou.user.service.impl;

import com.damuzee.core.util.StringUtil;
import com.damuzee.lvyou.user.domain.UserInfo;
import com.damuzee.lvyou.user.domain.UserReg;
import com.damuzee.lvyou.user.persistence.UserInfoMapper;
import com.damuzee.lvyou.user.persistence.UserRegMapper;
import com.damuzee.lvyou.user.service.UserInfoService;
import org.mybatis.sql.condition.Criteria;
import org.mybatis.sql.condition.Restrictions;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;

/**
 * Created by karkaw on 14-3-1.
 */

@Service
public class UserInfoServiceImpl implements UserInfoService {

    @Resource
    private UserInfoMapper userInfoMapper ;



    public void login(String userId, String password){
        UserInfo userInfo = new UserInfo();
        Criteria cri = new Criteria(UserInfo.class);
        if (StringUtil.isEmail(userId)){
            cri.and(Restrictions.eq("email", userId));
        }else{
            cri.and(Restrictions.eq("phono",userId));
        }
        userInfoMapper.selectByWhere(cri);
    }

}
